<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">


  <!-- 引入 layui.css -->
  <link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css">
  <link rel="stylesheet" href="css/bootstrap/bootstrap.min.css">

  <title>主页</title>


  <!-- 引入css -->

  <link rel="stylesheet" href="css/index.css">

</head>

<body>
  <div class="wrap">
    <!-- 页面外围框架 -->
    <div class="left main-box">
      <!-- 左边的盒子 -->

      <div class="btn-box">
        <button class="btn-left btn btn-secondary" id="selected" onclick="selectclick('{{CardInfo}}')">查询</button>
      </div>

      <div class="btn-box">
        <button class="btn-left btn btn-secondary" id="saved">存款</button>
      </div>

      <!-- 取款按钮 -->
      <button id="outMoney" class="btn-box btn btn-secondary"> 取款 </button>

      <!-- 挂失按钮 -->

      <div class="btn-box">
        <button type="button" id="lost" class="btn btn-secondary">挂失</button>
      </div>



    </div>


    <!-- 主体内容  银行信息 -->
    <div class="main main-box">
      <div class="main-text">
        <h2 style="text-align: center;">CtrlCV按键精灵银行欢迎你</h2>
        <h2 style="text-align: center">请选择你的服务</h2>
        <button type="button" style="margin-left:65px;" class="btn-left btn btn-secondary" onclick="logout()">注销</button>
      </div>
    </div>



    <!-- 右边的盒子 -->
    <div class="right main-box">
      <div class="btn-box">
      
        <!-- 转账按钮 -->
        <button class="btn btn-dark" id="transfer"> 转账 </button>
      
      
      </div>
      <div class="btn-box">
        <button class="btn-right btn btn-dark" id="changePwd">改密</button>
      </div>

      <div class="btn-box">
        <button class="btn-right btn btn-dark" id="openUid" onclick="openclick('{{uid}}')">开户</button>
      </div>
      <div class="btn-box">
        <button class="btn-right btn btn-dark" id="rmove" onclick="remove">销卡</button>
      </div>

    </div>

    <p>{{CardInfo}}</p>


</body>
<!-- 引入功能js -->
<script src="js/open.js"></script>
<script src="js/select.js"></script>
<script src="js/change.js"></script>
<script src="js/save.js"></script>
<script src="js/outMoney.js"></script>
<script src="js/lost.js"></script>
<script src="js/transfer.js"></script>
<script src="js/rmove.js"></script>

<!-- 引入js -->
<script src="js/index.js"></script>

<!-- 引入request -->
<script src="js/request.js"></script>

<!-- 引入JQuery(必先) -->
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="js/jquery-3.6.0.min.js"></script>
<script src="css/bootstrap/bootstrap.min.js"></script>
<!-- axios -->
<script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>

<!-- 引入 layui.js -->
<script src="//unpkg.com/layui@2.6.8/dist/layui.js"></script>


<script>

  layui.use(['layer', 'form', 'laytpl'], function () {
    var layer = layui.layer
      , form = layui.form
      , laytpl = layui.laytpl;
    //进入主页后弹出
    layer.msg('hello');
  });

  //弹出查询信息
  function selectclick() {
    selected();
  };
  //弹出存款信息
  $('#saved').on('click', function () {
    saved();
  });
  //弹出改密信息
  $('#changePwd').on('click', function () {
    changed();
  });
  //弹出取款信息
  $('#outMoney').on('click', function () {
    outMoney();
  });
  //弹出挂失
  $('#lost').on('click', function () {
    lost();
  });
  //弹出转账信息
  $('#transfer').on('click', function () {
    transfer();
  });

  //弹出开户信息
  function openclick(id) {
    opened(id);
  }

  $("#rmove").click(function () {
     remove();

});

function logout() {
            $.ajax({
                url: "/logout",
                type: "POST",
                dataType: "json",
                success: function (res) {
                    console.log(res);
                    if (res.code === 200) {
                        window.location.href = "/login";
                    }
                },
                error: function (msg) {
                    console.log('网络或者服务器有问题');
                }
            })
        }


</script>

</html>